#ifndef _TIME_H
#define _TIME_H

#include "WinMain.h"

const short MAX_COUNT = 50;

class Timer
{
public:
	//--------------------------------------------------------------------------------
	// Construction and Destruction for this class
	//--------------------------------------------------------------------------------
	Timer(void);
	~Timer(void);

	//--------------------------------------------------------------------------------
	// Public Functions for this class
	//--------------------------------------------------------------------------------
	void				Tick(float fLockFPS=0.0f);	// TIme
	float				GetTimeElased();
	unsigned short		GetFrameRate(LPTSTR lpszFrameRate = NULL);
	float				GetGameTime(); // milisecond
private:
	//--------------------------------------------------------------------------------
	// Private functions for this class
	//--------------------------------------------------------------------------------
	bool				m_PerfHardware;							// Flag checks Performance Counter
	float				m_TimeScale;							// Amount to scale counter
	float				m_FPSTimeElased;						// How much time has pass, is there enough 1 second ???
	float				m_TimeElased;							// Time Per Second
	__int64				m_PerfFreq;								// Is there Performance Counter ???
	__int64				m_LastTime;								// Last frame time
	__int64				m_CurrentTime;							// Current frame time

	float				m_FrameTime[MAX_COUNT];
	unsigned short		m_FrameTimeCount;

	unsigned short		m_FrameRate;								// FPS
	unsigned short		m_FPSFrameCount;							// FPS Counter 
};

#endif